import java.util.Scanner;

public class Demo {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		double jbgz;
		double wjjt;
		double fzjt;
		String str;
		System.out.println("输入基本工资：");
		while (!input.hasNextDouble()) {
			str = input.next();
			System.err.println("输入有误，请重新输入基本工资：");
		}
		jbgz = input.nextDouble();
		if (jbgz <= 0) {
			System.err.println("工资不能为负或者零！");
		} else {
			wjjt = jbgz * 0.4;
			fzjt = jbgz * 0.25;
			System.out.println("物价津贴=" + wjjt);
			System.out.println("房租津贴=" + fzjt);
		}

	}
}
